import java.util.Random;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:恋恋
 * Date:2022-08-29
 * Time:14:48
 */
public class Rand {
    public static void main(String[] args) {
        Random rand=new Random();
        int tend0= rand.nextInt(50);//[0,49)
        int tend=rand.nextInt(50)+50;//[0,49)-->[50,99)
        int tend1=rand.nextInt(30)+40;//[0,29)-->[40,69)
        Scanner sc=new Scanner(System.in);//System.in是从键盘输入
        while(true)//Java中只有true和fault
        {
            System.out.println("请输入数字：");
            int sca= sc.nextInt();
            if(sca<tend)
            {
                System.out.println("小了");
            }
            else if(sca>tend)
                System.out.println("大了");
            else if(sca==tend)
            {
                System.out.println("猜对了");
                break;
            }
        }
    }
}
